package parameter

import (
	"github.com/gogf/gf/v2/frame/g"
	"time"
)

type CreateTaskReq struct {
	g.Meta     `path:"/create" method:"post"`
	ParentId   uint      `p:"parentId"  d:"0" dc:"父任务ID"`
	ProjectId  uint      `p:"projectId"  d:"1" v:"required#项目Id必填" dc:"项目ID"`
	TaskName   string    `p:"taskName"  d:"1" v:"required#任务名称必填" dc:"任务名称"`
	TaskCode   string    `p:"taskCode"  d:"1"  dc:"任务编码"`
	StartDate  time.Time `p:"startDate"  dc:"任务计划开始日期"`
	EndDate    time.Time `p:"endDate"  dc:"任务计划结束日期"`
	Remark     string    `p:"remark" dc:"备注" `
	operatorId uint
}

func (s *CreateTaskReq) SetOperatorId(operatorId uint) {
	s.operatorId = operatorId
}
func (s *CreateTaskReq) GetOperatorId() uint {
	return s.operatorId
}

type CreateTaskRes struct {
}
type SaveTaskReq struct {
	g.Meta     `path:"/save" method:"post"`
	TaskId     uint      `p:"taskId"  v:"required#任务Id必填" dc:"任务ID"`
	TaskName   string    `p:"taskName"  v:"required#任务名称必填" dc:"任务名称"`
	TaskCode   string    `p:"taskCode"  dc:"任务编码"`
	StartDate  time.Time `p:"startDate"  dc:"任务计划开始日期"`
	EndDate    time.Time `p:"endDate"  dc:"任务计划结束日期"`
	Remark     string    `p:"remark" dc:"备注"`
	operatorId uint
}

func (s *SaveTaskReq) SetOperatorId(operatorId uint) {
	s.operatorId = operatorId
}
func (s *SaveTaskReq) GetOperatorId() uint {
	return s.operatorId
}

type SaveTaskRes struct {
}

type ListTaskReq struct {
	g.Meta    `path:"/list" method:"post"`
	ProjectId uint `json:"projectId"  d:"0" v:"required#项目Id必填" dc:"项目ID"`
}
type ListTaskRes struct {
	Detail []*GetTaskRes `json:"detail" description:"列表"`
}
type GetTaskRes struct {
	ParentId       uint          `json:"parentId"  dc:"父任务ID"`
	TaskId         uint          `json:"taskId"  dc:"任务ID"`
	TaskName       string        `json:"taskName"  dc:"任务名称" `
	TaskCode       string        `json:"taskCode"  dc:"任务编码"`
	StartDate      string        `json:"startDate"  dc:"开始日期"`
	EndDate        string        `json:"endDate"  dc:"结束日期"`
	TaskStatus     uint          `json:"taskStatus"  dc:"任务状态"`
	TaskStatusName string        `json:"taskStatusName"  dc:"任务状态名称"`
	MemberId       uint          `json:"memberId"  dc:"项目成员ID"`
	MemberName     string        `json:"memberName"  dc:"任务处理人" `
	Remark         string        `json:"remark"  dc:"备注" `
	Children       []*GetTaskRes `json:"child" description:"子节点"`
}
type DeleteTaskReq struct {
	g.Meta     `path:"/delete" method:"post"`
	TaskId     uint `json:"taskId"  dc:"任务ID"`
	operatorId uint
}

func (s *DeleteTaskReq) SetOperatorId(operatorId uint) {
	s.operatorId = operatorId
}
func (s *DeleteTaskReq) GetOperatorId() uint {
	return s.operatorId
}

type DeleteTaskRes struct {
}
type DistributeTaskReq struct {
	g.Meta     `path:"/distribute" method:"post"`
	TaskId     uint      `json:"taskId"  dc:"任务ID"`
	MemberId   uint      `json:"memberId"  dc:"成员ID"`
	StartDate  time.Time `json:"startDate"  dc:"开始日期"`
	EndDate    time.Time `json:"endDate"  dc:"结束日期"`
	operatorId uint
}

func (s *DistributeTaskReq) SetOperatorId(operatorId uint) {
	s.operatorId = operatorId
}
func (s *DistributeTaskReq) GetOperatorId() uint {
	return s.operatorId
}

type DistributeTaskRes struct {
}
type GetTaskTimeLineReq struct {
	g.Meta `path:"/time-line" method:"post"`
	TaskId uint `json:"taskId"  d:"0" v:"required#任务Id必填" dc:"任务ID"`
}
type GetTaskTimeLineRes struct {
	Detail []*TaskTimeLineRes `json:"detail" description:"列表"`
}
type TaskTimeLineRes struct {
	Title   string `json:"title"  dc:"标题"`
	Content string `json:"content"  dc:"内容"`
}
type MyTaskReq struct {
	g.Meta    `path:"/my-task" method:"post"`
	ProjectId uint `json:"projectId"  d:"0" v:"required#项目Id必填" dc:"项目ID"`
	userId    uint
}

func (s *MyTaskReq) SetUserId(userId uint) {
	s.userId = userId
}
func (s *MyTaskReq) GetUserId() uint {
	return s.userId
}

type MyTaskRes struct {
	Detail []*GetTaskRes `json:"detail" description:"列表"`
}
type BeginTaskReq struct {
	g.Meta    `path:"/begin-task" method:"post"`
	TaskId    uint      `json:"taskId"  d:"0" v:"required#任务Id必填" dc:"任务ID"`
	StartDate time.Time `json:"startDate"  v:"required#开始日期必填" dc:"开始日期"`
	userId    uint
}

func (s *BeginTaskReq) SetUserId(userId uint) {
	s.userId = userId
}
func (s *BeginTaskReq) GetUserId() uint {
	return s.userId
}

type BeginTaskRes struct {
}
type DoneTaskReq struct {
	g.Meta  `path:"/done-task" method:"post"`
	TaskId  uint      `json:"taskId"  d:"0" v:"required#任务Id必填" dc:"任务ID"`
	EndDate time.Time `json:"endDate"  v:"required#完成日期必填" dc:"完成日期"`
	userId  uint
}

func (s *DoneTaskReq) SetUserId(userId uint) {
	s.userId = userId
}
func (s *DoneTaskReq) GetUserId() uint {
	return s.userId
}

type DoneTaskRes struct {
}
